package com.training.client;

import java.rmi.RemoteException;

import org.apache.axis2.AxisFault;

import net.webservicex.www.ConvertSpeedsStub;
import net.webservicex.www.ConvertSpeedsStub.ConvertSpeed;
import net.webservicex.www.ConvertSpeedsStub.ConvertSpeedResponse;
import net.webservicex.www.ConvertSpeedsStub.SpeedUnit;

public class ConvertService {

	/**
	 * @param args
	 * @throws AxisFault 
	 */
	public static void main(String[] args) throws AxisFault {
		

		ConvertSpeedsStub convertSpeedsStub = new ConvertSpeedsStub();
		
		
		 
		
		
		
		ConvertSpeed convertSpeed = new ConvertSpeed();
		SpeedUnit speedUnitFrom = new SpeedUnit("milesPerhour",true);
		 
		convertSpeed.setFromUnit(speedUnitFrom);

		SpeedUnit speedUnitTo = new SpeedUnit("kilometersPerhour",true);
		convertSpeed.setToUnit(speedUnitTo);
		convertSpeed.setSpeed(200.34);
		
		try {
			ConvertSpeedResponse convertSpeedResponse  = convertSpeedsStub.convertSpeed(convertSpeed);
 			System.out.println("Speed is "+convertSpeedResponse.getConvertSpeedResult());
 			
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
	}

}
